package cn.dancepeak.exception;

import cn.dancepeak.constants.ErrorCode;

//全局异常
public class GlobalException extends RuntimeException{
    private Integer code;

    public Integer getCode() {
        return code;
    }

    public GlobalException(String message){
        super(message);
    }

    public GlobalException(ErrorCode errorCode){
        super(errorCode.getMessage());
        this.code = errorCode.getCode();
    }

    public GlobalException(Integer code , String message){
        super(message);
        this.code = code;
    }
}
